const db = require('../db/index')


exports.getFood = (req, res) =>{
    db.query(sqlStr, (err, results) => {
        if(err) throw err
        res.send(results)
    })
}
exports.preupdateindex = (req, res) =>{
    const id = req.body.id;
    db.query('select * from sys_index where id=?',[id], (err, results) => {
        if(err) throw err
        res.send(results)
    })
}
// 定义sql语句
const sqlStr = 'select * from sys_food'
